package com.cskaoyan.javase.annotation._4config;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;

/**
 * 客户端
 * @since 11:39
 * @author wuguidong@cskaoyan.onaliyun.com
 */
@TCPConfigAnno(port = 9999)
public class Client {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        Socket socket = new Socket(TCPUtils.getDefaultIP("com.cskaoyan.javase.annotation._4config.Client"), TCPUtils.getDefaultPort("com.cskaoyan.javase.annotation._4config.Client"));
        // 向服务端发送消息
        OutputStream out = socket.getOutputStream();
        out.write("今天晚上吃什么?".getBytes());
        socket.close();
    }
}
